package com.peza.mines.domain;


public class GameGrid {

	
	private static int[][] board;

	
	public static void openWater(int x, int y){
		
		for (int posy = -1; posy < 2; posy++){
			for (int posx = -1; posx < 2; posx++ ){
				if (posx != x && posy != y){
					try {
						if (board[(y + posy)][(x + posx)] == 0){
							board[(y + posy)][(x + posx)] = -1;
							openWater((y + posy),(x + posx));
						}
					} catch (ArrayIndexOutOfBoundsException e) {
						// do nothing
					}	
				}
			}
		}
	}
	
	
	public static void main (String [] args) {
		Board gameboard = new Board(10,4);
		//board = gameboard.getBoard();
		System.out.println("Created board \n" + gameboard.toString());
		
		//openWater(3,3);
		//gameboard.setBoard(board);
		//System.out.println("Updated board \n" + gameboard.toString());
	}
	
	
}
